import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'element-ui/lib/theme-chalk/index.css';
import elementUI from 'element-ui'
import VueSocketIO from 'vue-socket.io'


Vue.config.productionTip = false
Vue.use(elementUI)

let vueSocketIo = new VueSocketIO({
  debug: false,
  connection: 'http://127.0.0.1:7001',
  // connection: 'https://node.utools.club',
  options: { path: '/socket.io' }
})
// 监听connect事件，设置isSuccessConnect为true
vueSocketIo.io.on('connect', () => {
  console.log('socket connect from main.js')
  store.commit('newIsSuccessConnect', true)
})
Vue.use(vueSocketIo)


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
